﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AviBreak.aspx.cs" Inherits="SaicMotor.AviBreak" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="js_css/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="js_css/bootstrap/css/bootstrap-theme.css" rel="stylesheet" />
    <link href="js_css/bootstrap/css/bootstrap-table.css" rel="stylesheet" />
    <link href="js_css/bootstrap/css/bootstrap-select.css" rel="stylesheet" />
    <script src="js_css/js/jquery-3.2.1.js"></script>
    <script src="js_css/bootstrap/js/bootstrap.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-select.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-table.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-table-export.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-table-locale-all.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-table-zh-CN.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-datetimepicker.js"></script>
    <script src="js_css/bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="js_css/bootstrap/js/tableExport.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>AVI故障</title>
</head>
<body>
    <form id="form1" runat="server">
        <div class="col-xs-2">
            <div class="input-group">
                <span class="input-group-addon" id="故障明细">故障明细</span>
                <input type="text" class="form-control" aria-describedby="故障明细" id="txtWarningDetail" />
            </div>
        </div>
        <div class="col-xs-4">
            <div class="input-group">
                <span class="input-group-addon" id="开始时间">开始时间</span>
                <div class="input-daterange input-group" id="datepicker">
                    <input type="text" class="form-control" name="start" id="txtBeginTime" placeholder="2017-04-30 06:13:27" />
                    <span class="input-group-addon">至</span>
                    <input type="text" class="form-control" name="end" id="txtEndTime" placeholder="2017-05-30 05:13:27" />
                </div>
            </div>
        </div>
        <div class="col-xs-2 ">
            <div class="input-group">
                <span class="input-group-btn">
                    <button type="button" class="btn btn-info btn-search" onclick="GetData();">搜索</button>
                </span>
            </div>
        </div>
        <table id="table" class="table table-condensed">
        </table>
    </form>
    <script type="text/javascript">
        $(function () {
            $('#table').bootstrapTable({
                url: '/SaicMotor.asmx?action=ANDON_StopLineAlarm',
                method: 'get',
                dataType: 'json',
                sidePagination: 'server',//分页方式：client客户端分页，server服务端分页(*)
                pagination: true,//是否显示分页(*)
                queryParamsType: 'limit',//传递参数(*)
                cache: false,
                pageNumber: 1,//初始化加载第一页，默认第一页(*)
                pageSize: 50,//每页的记录行数(*)
                pageList: [50, 300, 500, 1000 ],//可供选择的每页的行数(*)
                toolbar: '#toolbar',
                clickToSelect: true,//是否启用点击选中行
                showRefresh: true, // 是否显示刷新按钮
                showExport: true,  //是否显示导出按钮  
                buttonsAlign: "right",  //按钮位置  
                exportTypes: ['excel'],  //导出文件类型  
                exportDataType: 'basic',//basic,all,selected 基本，所有，选择的
                cache: false, // 不缓存
                striped: true, // 隔行加亮
                showColumns: false, // 开启自定义列显示功能
                showRefresh: true, // 开启刷新功能
                columns: [
                    {
                    field: 'RecordID',
                    title:'编号'
                    },
                    
                   {
                    field: 'Text1',
                    title: '故障详细记录'
                    },
                {
                    field: 'TimeDiff',
                    title: '故障频次'
                },
                {
                    field: 'AlarmTag',
                    title: '故障时长'
                },
                {
                    field: 'DateTime',
                    title: '故障最后发生时间'
                }]
            });
        })

        function GetData() {
            var _url = '/Ajax_Handler/Handler.ashx?action=ANDON_StopLineAlarm';
            _url += '&Warning=' + $('#txtWarning').val();
            _url += '&WarningDetail=' + $('#txtWarningDetail').val();
            _url += '&BeginTime=' + $('#txtBeginTime').val();
            _url += '&EndTime=' + $('#txtEndTime').val();
            $('#table').bootstrapTable('refresh', { url: _url });
        }
    </script>
</body>
